﻿@model S4Store.Models.AfterSaleReport.AfterSaleSellerDecoratingReportModel
@{
    ViewBag.Title = "CarBrandDecoratingSaleKPI";
    Layout = null;
}

@{
    var config = Model.MonthConfig.FirstOrDefault();
    var daydata = Model.DayData;
 }

 @Html.Action("ReportBar", "Common", Model.BarModel)

 @if(config==null){
     
     <p>数据未配置（月初）</p>
         
 }else
 {
<div style="height: 100%; overflow: auto">
<div class="pagetitle">
    @(config.Employee.Name)服务顾问用品过程KPI
</div>
<div style=" padding:0 50px">
<table>
            <tr>
                
                <td>
                    <table class="reporttable" style="border-collapse: collapse;">
  <tr>
    <th align="center"><div>售后前台接待姓名</div></th>
    <th align="center" class="tb_header_greenbg"><div>接待前台职业资质</div></th>
    <th align="center"  class="tb_header_greenbg"><div>用品目标销售额[万]</div></th>
    <th align="center"  class="tb_header_greenbg"><div>累计入台次厂</div></th>
    <th align="center"  class="tb_header_greenbg"><div>累计用品销售额</div></th>
    <th align="center"  class="tb_header_greenbg"><div>用品销售额完成率</div></th>
    <th align="center"  class="tb_header_greenbg"><div>单车用品销售额[万]</div></th>
  </tr>
  <tr>
    <td>@config.Employee.Name </td>
    <td>@(config.Employee.WorkYear)年</td>
    <td>@config.JPMBXSE_CompetitiveSaleTarget</td>

    <td>@daydata.Sum(o=>o.SGRCTC_AccidentToFactory+o.WXRCTC_MaintentceToFactory)</td>
    <td>@daydata.Sum(o=>o.LJJPXSE)</td>

    @{
     var 用品销售完成率 = config.JPMBXSE_CompetitiveSaleTarget == 0 ? 0 : daydata.Sum(o => o.LJJPXSE) / config.JPMBXSE_CompetitiveSaleTarget;
    }
    <td>@Math.Round(用品销售完成率 * 100, 0, MidpointRounding.AwayFromZero)%</td>
    

    <td>@Math.Round((daydata.Sum(o => o.SGRCTC_AccidentToFactory + o.WXRCTC_MaintentceToFactory) == 0 ? 0 : daydata.Sum(o => o.LJJPXSE) / (decimal)(daydata.Sum(o => o.SGRCTC_AccidentToFactory + o.WXRCTC_MaintentceToFactory))), 2)</td>

  </tr>

</table>
</td>
     <td>
                    @Html.Partial("../Chart/Pie", Model.TimeRate)
                </td>
</tr>
            
</table>
</div>
</div>
}